//NOTE to self, do a state class. When state changes the input changes and should accept it as is

//e.g. if state=Project then cin>>int(choice) if 0 then state=function then cin>>int(choice) is for the functions in the program then state=addtest then cin>>string(test) is the test in the language I will create. e.g. 0 before 15 or 0 atleast 29 then this is transformed into what 15 and 0 represent and there you go we have a test

/**
* \class AddTest
* \brief This class is the main engine of adding new Test Criterion to any projects.
* It automatically tracks in which state we are and by simply moving forward or backward can set the string to be printed on the screen.
* \author Elie M. Shaccour (elie.shaccour@gmail.com)
* 
*/



#ifndef ADDTEST_H
#define ADDTEST_H

class Program;
class AntlrAdapter;
/*! This is the main class for the application. It is responsible for getting the projects for the user after he logs in, then getting the functions
in the project. After the user choses the functions, it will display the lines in the project and help him set the testcriteria
*/

class AddTest{

///< This enum type is used to keep track in which state of the project we are to know what to display on the screen
enum State{
	ChooseFunction,
	ChooseCriteria,
	ChooseTest,
	Invalid//To quit the loop at any time or if the user doesnt have any registered projects
	};

private:
///< Current AppState Variable 
	State CurrentState;
///< This variable holds the functions in the program with their properties 
	Program *CurrentProgram;
///< This variable is used to know if we are in GUI or CMD mode 
	bool IsGUI;
///< This variable keeps track of what was should be printed on the screen 
	std::string Print;
/// Number of current function we are working in
	int CurrentFunction;
/// Criteria set by the user 
	std::string Criteria;
/// Test file set for the criteria
	std::string Test;
	AntlrAdapter *C_LR;

	/**     \brief Will change a du<0,5> into actual description. Will parse the def and use line numbers and get their description from ANTLR
        *       \return String containing the acctual description of the du-pair 
        */
	std::string DefUse();
///Current Project working on
	int CurrentProject;
///To keep track of what the destructor should delete
	bool DeleteProgram;

	std::vector<std::string> TestCriteria;
	std::vector<std::string> TestFile;

public:
        /**     \brief Initialize the class knowing whether it is in GUI format or CMD mode, helps know the log info
        *       \param Is_GUI boolean variable 'T' if GUI 'F' if not GUI
        */
	AddTest(bool Is_GUI);
	~AddTest();

	/**     \brief Instruments the class to change the state and go forward to the next state thus setting 
	*the variable Print if anything needs to be printed on screen
        *       \param UserInput is the choice passed from the user
        */
	void GoForward(std::string UserInput);

        /**     \brief Instruments the class to go backward one state, the current data set will be lost
        */
	void GoBackward();

        /**     \brief Gets string to be printed on the screen
        *       \return Returns string to be printed
        */
	std::string GetPrint();

	/**     \brief Checks if we are currently in a valid state i.e. CurrentState!=Invalid 
        *       \return True if valid or False if state is invalid
        */
	bool IsValid();

	/**	\brief Gets the Test Criteria set by the user
	*	\return Test Criteria from the test
	*/
	std::vector<std::string> GetTestCriteria();

	/**     \brief Gets the Test Files set by the user
        *       \return Test Files for the test criteria
        */
	std::vector<std::string> GetTestFile();

};


#endif
